import {CFormGroupProps} from "@/components/CProForm/CFormItem/type";
import {SysCompanyInfoData} from "@/pages/company/type";

// @ts-ignore
export const field: CFormGroupProps<any>[] =( company: SysCompanyInfoData, setCompany: any) =>  [
  {
    itemList: [
      {
        name: "companyName",
        label: "名称",
        width: "md",
        placeholder:"请输入名称",
        rules: [
          {
            required: true,
            message: "名称是必须的",
          }
        ]
      },

    ],
  },
  {
    itemList: [
      {
        name: "companyLogo",
        label: "公司logo",
        width: "md",
        type: "upload-image",
        componentProps:{
          listType: "picture-card",
          showUploadList: false,
          button: true,
          value: company.companyLogo
        },

        rules: [
          {
            required: true,
            message: "公司logo是必须的",
          }
        ]
      },
    ],
  },
  {
    itemList: [
      {
        name: "companyLocation",
        label: "公司地址",
        width: "md",
        type: "map",
        componentProps:{
          longitude: company.longitude,
          latitude: company.latitude,
          companyLocation: company.companyLocation,
          setCompany: setCompany,
          company: company
        },
        rules: [
          {
            required: true,
            message: "公司地址是必须的",
          }
        ]
      }
    ]
  },
  {
    itemList: [
      {
        name: "phone",
        label: "联系电话",
        width: "md",
        rules: [
          {
            required: true,
            message: "联系电话是必须的",
          }
        ]
      },
      {
        name: "email",
        label: "电子邮箱",
        width: "md",
        rules: [
          {
            required: true,
            message: "电子邮箱是必须的",
          }
        ]
      }
    ]
  },
  {
    itemList: [
      {
        name: "contact",
        label: "联系信息",
        type: "text",
        width: "md",
        rules: [
          {
            required: true,
            message: "联系信息是必须的",
          }
        ]
      }
    ]
  },
]
